class LrcParser {
    data class LrcLine(val time: Long, val text: String)

    fun parse(lrcContent: String): List<LrcLine> {
        val lines = lrcContent.split("\n")
        val result = mutableListOf<LrcLine>()
        
        for (line in lines) {
            if (line.isBlank()) continue
            
            val timeRegex = "\\[(\\d{2}):(\\d{2})\\.(\\d{2})](.*)".toRegex()
            val matchResult = timeRegex.find(line) ?: continue
            
            val (minutes, seconds, hundredths, text) = matchResult.destructured
            val timeInMillis = (minutes.toInt() * 60 * 1000 +
                    seconds.toInt() * 1000 +
                    hundredths.toInt() * 10).toLong()
            
            result.add(LrcLine(timeInMillis, text.trim()))
        }
        
        return result.sortedBy { it.time }
    }
} 